#ifndef FACTORYSETTING_H
#define FACTORYSETTING_H

#include <QDialog>
#include "canbusiothread.h"
#include "serialportio.h"

namespace Ui {
class FactorySetting;
}

class FactorySetting : public QDialog
{
    Q_OBJECT

public:
    explicit FactorySetting(QWidget *parent = nullptr);
    ~FactorySetting();
    CanBusIoThread* canbusIo;

    //产品名称
    QString productName;

    //产品名称
    int interFaceIndex;

    //接口列表
    QList<QString> interfaceList;



    void InitCanbusSlots();
    QString __file_browse();
    void InitDatas();
    void InitSerialSlots();
private slots:

    void on_btnConnTF_clicked();

    void slotDisplay(QVector<uint16_t> _dist, QVector<uint16_t> _amp, const StringVector &_hexRxFrames, int _freq);

    void slotSerialPortUpdate();


    void on_cbCommContract_currentTextChanged(const QString &arg1);

    void on_btnSelectProfile_clicked();

private:


    Ui::FactorySetting *ui;
    serialportio *sensorRecver_;

    QList<QSerialPortInfo> serialList_;

    QString serialSelected_;



    QThread *workThread_;


    QVector<QPointF> oldPoints_, points_, pointsTemp_;

    QTimer *distUpdateTimer_;

    QTimer *distTimerModbus;

    QTimer *distTimerIIC;

    QTimer *timerSerialPortSearch;

    int baudRate_;


};

#endif // FACTORYSETTING_H
